//
//  PopularityTableViewCell.m
//  AndCampus
//
//  Created by 史宵宵 on 2017/12/6.
//  Copyright © 2017年 史宵宵. All rights reserved.
//

#import "PopularityTableViewCell.h"


@implementation PopularityTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (void)setPopularityInfo:(PopularityInfo *)popularityInfo{
    self.numLabel.text = popularityInfo.rank;
    if ([popularityInfo.rank isEqualToString:@"1"]) {
        self.touImageView.hidden = NO;
    }else{
        self.touImageView.hidden = YES;
    }
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:popularityInfo.icon] placeholderImage:KRECOMMENDLISTDEFAULT];
    self.iconImage.userInteractionEnabled = YES;
    [self.iconImage addGestureRecognizer:[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(enterImageView:)]];
    self.nickNamelabel.text = popularityInfo.nick_name;
    self.scoreLabel.text = popularityInfo.value;
}
- (void)enterImageView:(UIGestureRecognizer *)sender{
    if (self.enterImageViewBlock) {
        self.enterImageViewBlock(self.popularityInfo);
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
